﻿//Write program that asks for a digit and depending on the input shows the name of that digit (in English) using a switch statement.

using System;

class PrintDigitName
{
    static void Main()
    {
        Console.Write("Enter digit: ");
        string digitString = Console.ReadLine();
        byte digit;
        while (
            !byte.TryParse(digitString, out digit) &&
            digit >= 0 &&
            digit <= 9
            )
        {
            Console.Write("Ivalid input. Please eneter the digit again: ");
            digitString = Console.ReadLine();
        }
        string digitName;
        switch (digit)
        {
            case 0: digitName = "Zero"; break;
            case 1: digitName = "One"; break;
            case 2: digitName = "Two"; break;
            case 3: digitName = "Three"; break;
            case 4: digitName = "Fours"; break;
            case 5: digitName = "Five"; break;
            case 6: digitName = "Six"; break;
            case 7: digitName = "Seven"; break;
            case 8: digitName = "Eight"; break;
            case 9: digitName = "Nine"; break;
            default: digitName = "Not a digit"; break;
        }
        Console.WriteLine("Name of the digit {0} is {1}.", digit, digitName);
    }
}
